package com.dbf.forum.core.offre;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.dbf.forum.common.core.ModelObject;
import com.dbf.forum.core.produit.Produit;
import com.dbf.forum.user.model.User;

@Entity
@Table(name = "Offre")
public class Offre extends ModelObject implements Serializable{
	
	private static final long serialVersionUID = -6534796937746042614L;

	@Id()
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "O_ID")
	private Long id;
	
	@Column(name = "montant")
	private Double montant;
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dat_offre")
	private Date dateOffre;
	
	@Column(name = "statut")
	private String statut;
	
	@ManyToOne
	@JoinColumn(name = "A_ID")
	private User acheteur;
	
	@JoinColumn(name = "P_ID")
	@ManyToOne
	private Produit produit;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Double getMontant() {
		return montant;
	}

	public void setMontant(Double montant) {
		this.montant = montant;
	}

	public Date getDateOffre() {
		return dateOffre;
	}

	public void setDateOffre(Date dateOffre) {
		this.dateOffre = dateOffre;
	}

	public String getStatut() {
		return statut;
	}

	public void setStatut(String statut) {
		this.statut = statut;
	}

	public User getAcheteur() {
		return acheteur;
	}

	public void setAcheteur(User acheteur) {
		this.acheteur = acheteur;
	}

	public Produit getProduit() {
		return produit;
	}

	public void setProduit(Produit produit) {
		this.produit = produit;
	}

}
